package com.tanhua.manage.controller;

import com.tanhua.manage.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/manage")
public class UserController {

    @Autowired
    private UserService userService;

    //用户数据翻页
    @GetMapping("/users")
    public ResponseEntity<Object> showUsers(Integer page,  Integer pagesize){
        return userService.queryUserByPage(page,pagesize);
    }

    //用户基本资料
    @GetMapping("/users/{userID}")
    public ResponseEntity<Object> showUserInfo(@PathVariable("userID")Long userID){
        return userService.showUserInfo(userID);
    }
}
